using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Presentation.Controls;

namespace $safeprojectname$
{
    /// <summary>Main Window For the application</summary>
    /// <remarks>
    /// Creates a Text region child element
    /// </remarks>
    public class MainViewWindow : Window
    {
        private Font SmallFont;

        /// <summary> Constructor for the window</summary>
        public MainViewWindow()
        {
            this.SmallFont = Resources.GetFont( Resources.FontResources.small );
            
            // panel control to fill the window client area
            Panel panel = new Panel();
            panel.HorizontalAlignment = HorizontalAlignment.Stretch;
            panel.VerticalAlignment = VerticalAlignment.Stretch;

            // text control to put inside the panel
            Text txt = new Text(this.SmallFont, "Hello World!");
            txt.HorizontalAlignment = HorizontalAlignment.Center;
            txt.VerticalAlignment = VerticalAlignment.Center;

            // Panel element can have multiple children
            panel.Children.Add(txt);
            
            // The window has exactly one child
            this.Child = panel;
        }
    }
}
